package com.hkbigdata.sybx.service.ipml;

import com.hkbigdata.sybx.bean.DietRecord;
import com.hkbigdata.sybx.bean.ExerciseLog;
import com.hkbigdata.sybx.bean.RestSchedule;
import com.hkbigdata.sybx.mapper.StateMapper;
import com.hkbigdata.sybx.service.StateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author liuanbo
 * @creat 2025-06-05-18:44
 * @see 2194550857@qq.com
 */
@Service
public class StateServiceImpl implements StateService {
    @Autowired
    private StateMapper stateMapper;

    // 饮食记录CRUD实现
    @Override
    public List<DietRecord> getDietRecord() {
        return stateMapper.DietRecordAll();
    }

    @Override
    public DietRecord getDietRecordById(Long dietId) {
        return stateMapper.getDietRecordById(dietId);
    }

    @Override
    public int insertDietRecord(DietRecord dietRecord) {
        return stateMapper.insertDietRecord(dietRecord);
    }

    @Override
    public int updateDietRecord(DietRecord dietRecord) {
        return stateMapper.updateDietRecord(dietRecord);
    }

    @Override
    public int deleteDietRecord(Long dietId) {
        return stateMapper.deleteDietRecord(dietId);
    }

    // 作息记录CRUD实现
    @Override
    public List<RestSchedule> getRestSchedule() {
        return stateMapper.RestScheduleAll();
    }

    @Override
    public RestSchedule getRestScheduleById(Long scheduleId) {
        return stateMapper.getRestScheduleById(scheduleId);
    }

    @Override
    public int insertRestSchedule(RestSchedule restSchedule) {
        return stateMapper.insertRestSchedule(restSchedule);
    }

    @Override
    public int updateRestSchedule(RestSchedule restSchedule) {
        return stateMapper.updateRestSchedule(restSchedule);
    }

    @Override
    public int deleteRestSchedule(Long scheduleId) {
        return stateMapper.deleteRestSchedule(scheduleId);
    }

    // 运动记录CRUD实现
    @Override
    public List<ExerciseLog> getExerciseLog() {
        return stateMapper.ExerciseLogAll();
    }

    @Override
    public ExerciseLog getExerciseLogById(Long exerciseId) {
        return stateMapper.getExerciseLogById(exerciseId);
    }

    @Override
    public int insertExerciseLog(ExerciseLog exerciseLog) {
        return stateMapper.insertExerciseLog(exerciseLog);
    }

    @Override
    public int updateExerciseLog(ExerciseLog exerciseLog) {
        return stateMapper.updateExerciseLog(exerciseLog);
    }

    @Override
    public int deleteExerciseLog(Long exerciseId) {
        return stateMapper.deleteExerciseLog(exerciseId);
    }
}